You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TDenseMtxVec Class > TDenseMtxVec Methods > TDenseMtxVec.DCT Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TDenseMtxVec.DCT Method

The forward discrete cosine transform (DCT).

Syntax
C#
Visual Basic
public TMtxVec DCT([In] TMtxVec Vec, int VecIndex, int Index, int Len);

Calculates the forward discrete cosine transform (DCT) of the Vec and writes the result in the calling vector. If Vec.Length is a power of 2, the function uses an efficient algorithm that is significantly faster than the direct computation of DCT. For other values of Vec Length, this function uses the direct formulas given below; however, the symmetry of cosine function is taken into account, which allows to perform about half of the multiplication operations in the formulas. In the following definition of DCT, N=Vec.Length and V is the calling vector: 

 

 

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { TVec a,b; MtxVec.CreateIt(out a, out b); try { a.SetIt(false,new double[] {1,-2,3,4}); b.DCT(a); } finally { MtxVec.FreeIt(ref a,ref b); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!